package com.yswy.common.utils;

/**
 * @Auther: Administrator
 * @Date: 2020/12/10 20:43
 * @Description:
 */
public enum HuaweiObsInfo {

    WEIGOU_DATA("北京四","cn-north-4","obs.cn-north-4.myhuaweicloud.com",
            "weigou-data","0BMSVRG9JMWA8QKWFOSH", "To0zo8GfdVMLd7ESvvadRDC3QS2eD5qmfVQIl0OV",1),
    WEIGOU_FILES("北京四","cn-north-4","obs.cn-north-4.myhuaweicloud.com",
            "weigou-files","YXHWNVDZX553NILA7T0B","upTHBG7uC2aiWuiJwlnTsFWzjIOBbYpuH6Rc3VVT",2),
    OBS_YSY_APKS("广州","cn-south-1","obs.cn-south-1.myhuaweicloud.com",
                         "obs-ysy-apks","SF4KCC62PGIALJA8FQJ4","8LDXJnZYFM5yd2mibbxlYMH6jzn0hxBNvea6kQEo",3),
    HAIWAI_WEIGOU("香港","ap-southeast-1","obs.ap-southeast-1.myhuaweicloud.com",
            "haiwai-weigou","0BMSVRG9JMWA8QKWFOSH","To0zo8GfdVMLd7ESvvadRDC3QS2eD5qmfVQIl0OV",4);


    HuaweiObsInfo(String areaName, String area, String endpoint, String bucketName, String ak, String sk, Integer sort) {
        this.areaName = areaName;
        this.area = area;
        this.endpoint = endpoint;
        this.bucketName = bucketName;
        this.ak = ak;
        this.sk = sk;
        this.sort = sort;
    }

    private String areaName;
    private String area;
    private String endpoint;
    private String bucketName;
    private String ak;
    private String sk;
    private Integer sort;

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public String getAk() {
        return ak;
    }

    public void setAk(String ak) {
        this.ak = ak;
    }

    public String getSk() {
        return sk;
    }

    public void setSk(String sk) {
        this.sk = sk;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public String toString() {
        return "HuaweiObsInfo{" +
                "areaName='" + areaName + '\'' +
                ", area='" + area + '\'' +
                ", endpoint='" + endpoint + '\'' +
                ", bucketName='" + bucketName + '\'' +
                ", ak='" + ak + '\'' +
                ", sk='" + sk + '\'' +
                ", sort=" + sort +
                '}';
    }

    public static HuaweiObsInfo getOneByBucketName(String bucketName) {
        if (StringUtils.isEmpty(bucketName)) {
            return null;
        }
        HuaweiObsInfo[] values = HuaweiObsInfo.values();
        for (HuaweiObsInfo value : values) {
            System.out.println(value);
            if (bucketName.equals(value.getBucketName())) {
                return value;
            }
        }
        return null;
    }


//    public static void main(String[] args) {
////        HuaweiObsInfo oneByBucketName = getOneByBucketName("weigou-data");
////        System.out.println(oneByBucketName.toString());
//        HuaweiObsInfo[] values = HuaweiObsInfo.values();
//        for (HuaweiObsInfo value : values) {
//            System.out.println(value);
//        }
//
//    }




}
